/**
 * Copyright (c) 2009, http://www.softwareinlife.com. All rights reserved.
 * 
 * Redistribution and use in source and binary forms, 
 * with or without modification, are permitted provided that 
 * the following conditions are met:
 * 
 * 1. Redistributions of source code must retain the above copyright notice, 
 *    this list of conditions and the following disclaimer.
 * 
 * 2. Redistributions in binary form must reproduce the above copyright notice, 
 *    this list of conditions and the following disclaimer in the documentation 
 *    and/or other materials provided with the distribution.
 * 
 * 3. Neither the name of the http://www.softwareinlife.com nor the names of its 
 *    contributors may be used to endorse or promote products derived from 
 *    this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE SOFTWAREINLIFE AND CONTRIBUTORS "AS IS" 
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 * ARE DISCLAIMED. 
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package com.softwareinlife.vision.android.communication.model;

import java.io.IOException;
import java.util.List;

import org.xmlpull.v1.XmlSerializer;

import com.softwareinlife.vision.android.data.model.PlanModel;
import com.softwareinlife.vision.android.data.model.UserModel;
import com.softwareinlife.vision.android.system.model.BaseModel;

/**
 * @author Jang, Sun-Jin (jangsunjin@softwareinlife.com)
 * @date 2009. 10. 10.
 */
public class VisionModel extends
		com.softwareinlife.vision.android.data.model.VisionModel
		implements IXmlWriter {

	/**
	 * Serial Version UID
	 */
	private static final long serialVersionUID = 1L;

	public static final String ELEMENT = "vision";
	public static final String ATTR_ID = "id";
	public static final String ATTR_CLIENT_ID = "clientId";
	public static final String ATTR_TITLE = "title";
	public static final String ATTR_STATEMENT = "statement";
	public static final String ATTR_EXPECT = "expect";
	public static final String ATTR_COLOR = "color";
	public static final String ATTR_BLUEPRINT = "blueprint";
	
	/**
	 * Constructor
	 */
	public VisionModel() {
		// TODO Auto-generated constructor stub
	}

	public VisionModel(com.softwareinlife.vision.android.data.model.VisionModel arg_visionModel) {
		// TODO Auto-generated constructor stub
		user = arg_visionModel.getUser();
		plans = arg_visionModel.getPlans();
		title = arg_visionModel.getTitle();
		statement = arg_visionModel.getStatement();
		expect = arg_visionModel.getExpect();
		blueprint = arg_visionModel.getBlueprint();
		privacy = arg_visionModel.getPrivacy();
	}

	public void toXMLString(XmlSerializer arg_serializer) 
		throws IllegalArgumentException, IllegalStateException, IOException
		{
			// TODO Auto-generated method stub
		arg_serializer.startTag("", ELEMENT);
		
		arg_serializer.attribute("", ATTR_ID, ids + "");
		arg_serializer.attribute("", ATTR_CLIENT_ID, clientId + "");
		
		if(null != title)
			arg_serializer.attribute("", ATTR_TITLE, title);
		if(null != statement)
			arg_serializer.attribute("", ATTR_STATEMENT, statement);
		if(null != expect)
			arg_serializer.attribute("", ATTR_EXPECT, expect);
		if(null != blueprint)
			arg_serializer.attribute("", ATTR_BLUEPRINT, blueprint);
		if(null != action)
			arg_serializer.attribute("", ATTR_ACTION, action);
		
		arg_serializer.endTag("", ELEMENT);
	}
	
}
